package ee.az.tetris.worker;

import ee.az.tetris.Glass;
import ee.az.tetris.event.Event;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author Artur Zinatullin (artur.zinatullin@gmail.com) 2010
 */
public class SequenceWorker extends Worker {

	private final List<Worker> workers;
	
	public SequenceWorker(Glass glass, Worker... workers) {
		super(glass);
		this.workers = new ArrayList<Worker>(Arrays.asList(workers));
	}

	@Override
	public void work(Event event) {
		for (Worker worker : workers) {
			worker.work(event);
		}
	}

}
